package day03;

import java.util.Arrays;

public class ParamDemo {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;

        change(a,b);
        System.out.println("main-a:"+a);
        System.out.println("main-b:"+b);

        System.out.println("====对象类型====");

        int[] arr1 = new int[]{1,2,3};

        change2(arr1);

        System.out.println("main-arr1-"+Arrays.toString(arr1));
    }

    private static void change2(int[] arr1){
        arr1[0] = 100;
        System.out.println("c2"+ Arrays.toString(arr1));
    }

    private static void change(int a,int b){
        a = a^b;
        b = a^b;
        a = a^b;

        System.out.println("change-a:"+a);
        System.out.println("change-b:"+b);
    }
}
